#include <cstdio>

int main()
{
	for(int i = 100; i <= 999; i++) {

		int G = i % 10;
		int S = i / 10 % 10;
		int B = i / 100;

		if(G*G*G + S*S*S + B*B*B == i) {
			printf("%d ", i);
		}
	}

	printf("\n");
	return 0;
}